class Solution
{
public:
    int maximumScore(int a, int b, int c)
    {
        vector<int> stones{a, b, c};
        sort(stones.begin(), stones.end());
        int result = stones[1] - stones[0];
        stones[1] -= result;
        stones[2] -= result;
        if (stones[2] >= 2 * stones[0])
        {
            result += 2 * stones[0];
        }
        else
        {
            result += stones[0] + stones[2] / 2;
        }
        return result;
    }
};